package com.sg.business.commons.field.editable;

import com.mobnut.db.model.PrimaryObject;
import com.sg.business.model.Document;
import com.sg.widgets.part.editor.fields.value.IFieldEditableHandler;

public class ContentVaultFoeWorkEditable implements IFieldEditableHandler {

	@Override
	public boolean isEditable(Object data, String key, Object value) {
		if (data instanceof PrimaryObject) {
			PrimaryObject po = (PrimaryObject) data;
			Object documentTemplateId = po
					.getValue(Document.F_INIT_DOCUMENT_TEMPLATE_ID);
			return documentTemplateId == null;
		}
		return false;
	}
}
